// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   SQLExceptionUtil.java

package com.sunwayhorizo.health.ets.exceptions.common;

import com.sunwayhorizo.health.hl7.common.VersionInfo;

import java.sql.SQLException;


public class SQLExceptionUtil extends Exception
{

    public static final String RCS_ID = "$Header: SQLExceptionUtil.java 115.5 2005/02/01 20:40:29 gkuhnen noship $";
    public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion("$Header: SQLExceptionUtil.java 115.5 2005/02/01 20:40:29 gkuhnen noship $", "oracle.apps.hct.exceptions.common.SQLExceptionUtil");
    private static final int ERROR_CODE_LENGTH = 9;
    private static final int ERROR_CODE_GROUP_LENGTH = 3;
    private static final String ERROR_CODE_GROUP = "DRG";
    private static final String errorCodes[] = {
        "DRG-50901", "DRG-51030"
    };

    public static boolean isCausedByUserInput(SQLException sqlexception)
    {
        String s = sqlexception.getMessage();
        for(int i = 0; i < errorCodes.length; i++)
        {
            int j = s.indexOf(errorCodes[i]);
            char c = s.charAt(j + 9);
            boolean flag = Character.isDigit(c);
            if(j != -1 && !flag)
                return true;
        }

        return false;
    }

    public SQLExceptionUtil()
    {
    }

}
